home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / Origami / bindings / modeori.keys < prev    next >
Text File  |  1996-09-26  |  15KB  |  475 lines

  1. ;OCL{{{}}}
  2. ;OCL{{{  notes
  3. @if-using (FOO) @if-using not(FOO)
  4.  
  5.  Modifying this Binding
  6.  **********************
  7.  
  8.  ;OCL{{{  bindings
  9.  You can add new commands simply by including this binding in your file:
  10.  
  11.     ;OCL{{{  your binding file
  12.     ;OCL{{{F modeori.keys
  13.     ;OCL:::F modeori.keys
  14.     ;OCL}}}
  15.     ;OCL{{{  your additional macros
  16.     :-)
  17.     ;OCL}}}
  18.     ;OCL{{{  your additional bindings
  19.     ;OCL}}}
  20.     ;OCL}}}
  21.  
  22.  Or you can use completely different bindings (but the same functions!):
  23.  
  24.     ;OCL{{{  your binding file
  25.     @use ( ALIEN-KEYTABLES )
  26.     ;OCL{{{F modeori.keys
  27.     ;OCL:::F modeori.keys
  28.     ;OCL}}}
  29.     ;OCL}}}
  30.     ;OCL{{{  your keytable file, named modeori.ktb
  31.     @if-using ( ALIASES )
  32.        ;OCL{{{  definition of your aliases!
  33.        ;OCL}}}
  34.     @fi
  35.     @if-using ( ABORT-KEY )
  36.        ;OCL{{{  definition of your abort key
  37.        ;OCL}}}
  38.     @fi
  39.     @if-using ( PARA-MODE )
  40.        ;OCL{{{  definition of your bindings in prompts
  41.        ;OCL}}}
  42.     @fi
  43.     @if-using ( MOVE-INDENT )
  44.        ;OCL{{{  definition of your bindings for shifting regions in move mode
  45.        ;OCL}}}
  46.     @fi
  47.     @if-using ( EDIT-MODE )
  48.        ;OCL{{{  definition of your bindings for editing
  49.        ;OCL}}}
  50.     @fi
  51.     @if-using ( MOVE-MODE )
  52.        ;OCL{{{  definition of your bindings for move mode
  53.        ;OCL}}}
  54.     @fi
  55.     @if-using ( BUFFER-MOVE-MODE )
  56.        ;OCL{{{  definition of your bindings for buffer move mode
  57.        ;OCL}}}
  58.     @fi
  59.     @if-using ( SHELL-MODES )
  60.        ;OCL{{{  define the tables for the shell
  61.        ;OCL}}}
  62.     @fi
  63.     ;OCL}}}
  64.  ;OCL}}}
  65.  ;OCL{{{  alien mode hooks
  66.  If the tag ALIEN-HOOKS is set, the following functions have to be defined.
  67.  They will be executed in front of the following hooks. They hace to use
  68.  return-value-from-macro with value <>0, if the default hook should not be
  69.  executed.
  70.  
  71.      alien-begin-prompt-macro
  72.      alien-end-prompt-macro
  73.      alien-read-newfile-macro
  74.      alien-change-buffer-macro
  75.      alien-abort-macro
  76.      alien-view-macro
  77.      alien-key-not-bound-macro
  78.  ;OCL}}}
  79.  ;OCL{{{  C extensions
  80.  The semantic of { and ; in for C and PASCALL can be changed by adding
  81.  the following befor you include modeori.keys:
  82.  
  83.     @use (MY-L-SEMICOLON)
  84.     ( deffun my-l-semicolon ( ... ) )
  85.     @use (MY-C-CB)
  86.     ( deffun my-c-cb ( ... ) )
  87.     @use (MY-P-CB)
  88.     ( deffun my-p-cb ( ... ) )
  89.     ...F modeori.keys
  90.  ;OCL}}}
  91.  ;OCL{{{  switches
  92.  Defining the tag NO-STANDARDS gives you the possibility to define your own
  93.  set of used tags.
  94.  
  95.     @use (NO-STANDARDS)
  96.     @use ( 'your tags' )
  97.     ...F modeori.keys
  98.  ;OCL}}}
  99.  ;OCL{{{  new file macro
  100.  The new-file macro can do an additionbal macro-call, if you define the macro
  101.  add-new-file and set the ocl-tag ADD-NEWFILE
  102.  ;OCL}}}
  103. @fi @fi
  104. @rc-comment origami bindings modeori 1.93, W. Stumvoll
  105. ;OCL}}}
  106. ;OCL{{{  useful @use
  107. ;
  108. ; using -U NO-STANDARDS overwrites the following section
  109. ;
  110. ; using -U BASE compiles this bindings with the default keybindings , control
  111. ; commands and simulted function keys.
  112. ;
  113. @if-using not(NO-STANDARDS)
  114.    ;OCL{{{  choose features
  115.    @use
  116.     ( W-GET-X-SEL
  117.           ;  enable compilation of get-selection
  118.       L-EXT
  119.           ;  enable some folding-language-dependent extensions
  120.           ;  occam,c and pascal: { ( [ ; and tab-stops
  121.       ; NO-HELP-BROWSER
  122.           ; don't support the menu driven info-viewer
  123.       SHELL-MODE
  124.           ; prepare the compilation of an additional shell-/filemanager-.. mode
  125.       GAMES
  126.           ; compile towers-of-hanoi ..
  127.     )
  128.    ;OCL}}}
  129.    ;OCL{{{  choose terminals
  130.    @if-using not(BASE)
  131.       @use
  132.        (
  133.          sun
  134.              ;  enable compilation of sun-specific terminal-keys
  135.          SUNEDT
  136.              ;  enable the compilation of sun specific edt simulation
  137.          linux
  138.              ;  enable compilation of linux-specific terminal-keys
  139.              ;  uses the keypad in a sun like way
  140.          linuxEDT
  141.              ; enable the compilation of the EDT simualtion for linux consoles
  142.              ; it can be accessed by using TERM/ORIGAMITERM==con80x25EDT
  143.          xterm
  144.              ;  enable the compilation of xterm-keymap
  145.          amiga
  146.              ; compile the amiga keytables, for $TERM=amiga
  147.          ; AMIGA
  148.              ;  enable the compilation of amiga keybindings.
  149.              ;  The amiga bindings will be the default binding and the
  150.              ;  other terminals won't be used.
  151.        )
  152.    @fi
  153.    @if-using ( BASE )
  154.       @use not( sun xterm AMIGA SUNEDT amiga )
  155.    @fi
  156.    ;OCL}}}
  157.    ;OCL{{{  AMIGA overwrites
  158.    @if-using (AMIGA)
  159.       @use not( sun xterm SUNEDT linux linuxEDT SHELL-MODE amiga )
  160.    @fi
  161.    ;OCL}}}
  162. @fi
  163. ;OCL}}}
  164. ;OCL{{{  cmd and shell-mode default values
  165. @if-using not( EXTERNAL-CMD-MACS )
  166.    ;OCL{{{  cmd-separator
  167.    ( defmac cmd-separator ( "; ) )
  168.    ;OCL}}}
  169.    ;OCL{{{  cd-cmd
  170.    ( defmac cd-cmd ( "cd ) )
  171.    ;OCL}}}
  172.    ;OCL{{{  make-cmd
  173.    ( defmac get-make-cmd-var ( getenv "MAKE_CMD ) )
  174.    ( defmac make-cmd-def ( "make ) )
  175.    ;OCL}}}
  176.    ;OCL{{{  spell-cmd
  177.    ( defmac get-spell-cmd-var ( getenv "SPELL_CMD ) )
  178.    @use ( NEW-DEF-SPELL )
  179.    ( defmac default-spell-command ( "spell ) )
  180.    ;OCL}}}
  181.    ;OCL{{{  mail-cmd
  182.    ( defmac mail-cmd-def ( "mail ) )
  183.    ( defmac get-mail-cmd-var ( getenv "MAIL_CMD ) )
  184.    ;OCL}}}
  185.    @if-using ( SHELL-MODE )
  186.       ;OCL{{{  cp-cmd
  187.       ( defmac cp-cmd ( "/bin/cp ) )
  188.       ;OCL}}}
  189.       ;OCL{{{  mv-vmd
  190.       ( defmac mv-cmd ( "/bin/mv ) )
  191.       ;OCL}}}
  192.       ;OCL{{{  rm-cmd
  193.       ( defmac rm-cmd ( "/bin/rm "  "-f ) )
  194.       ;OCL}}}
  195.       ;OCL{{{  nn-cmd
  196.       ( defmac get-nn-cmd-var ( getenv "NN_CMD ) )
  197.       ( defmac nn-cmd-def ( "nn ) )
  198.       ;OCL}}}
  199.       ;OCL{{{  edit-cmd
  200.       ( defmac get-edit-cmd-var ( getenv "EDIT_CMD ) )
  201.       ;OCL}}}
  202.       ;OCL{{{  browser-file
  203.       ( defmac default-browser-file ( "~/.oriinfo ) )
  204.       ;OCL}}}
  205.       ;OCL{{{  menu-file
  206.       ( defmac default-menu-file ( "~ ) )
  207.       ;OCL}}}
  208.       ;OCL{{{  edit-file
  209.       ( defmac default-edit-file ( "/dev/null ) )
  210.       ;OCL}}}
  211.    @fi
  212. @fi
  213. ;OCL}}}
  214. ;OCL{{{  marktypes
  215. ;OCL{{{  pascal
  216. (defmark pascal ( ("< "< "<)
  217.                   (". ". ".)
  218.                   (": ": ":)
  219.                   ("> "> ">)
  220.                 )
  221. )
  222. ;OCL}}}
  223. ;OCL{{{  script
  224. (defmark script  ( ("# "# "@)
  225.                    (". ". ".)
  226.                    ("# "# ":)
  227.                    ("# "# "$)
  228.                  )
  229. )
  230. ;OCL}}}
  231. ;OCL}}}
  232. ;OCL{{{  name of the bindings and its options
  233. ( defbinding
  234.    ModeOri
  235.  
  236.    ( "noshell          ">15=0 ) ( "shell           ">15=1 )
  237.                                 ( "xshell         ">15=-1 )
  238.  
  239.    ( "nold           ">0|8192 ) ( "ld       ">0|8192^8192 )
  240.    ( "center         ">0|4096 ) ( "nocenter ">0|4096^4096 )
  241.    ( "notime         ">0|2048 ) ( "time     ">0|2048^2048 )
  242.    ( "nooverstrike   ">0|1024 )
  243.    ( "noal            ">0|512 ) ( "al         ">0|512^512 )
  244.    ( "nofull          ">0|256 ) ( "full       ">0|256^256 )
  245.    ( "noai            ">0|128 ) ( "ai         ">0|128^128 )
  246.    ( "nomagic          ">0|96 ) ( "magic        ">0|96^32 )
  247.                                 ( "xmagic       ">0|96^96 )
  248.    ( "nohigh           ">0|16 ) ( "high         ">0|16^16 )
  249.    ( "nopos             ">0|8 ) ( "pos            ">0|8^8 )
  250.    ( "bs                ">0|4 ) ( "nobs           ">0|4^4 )
  251.    ( "noext             ">0|2 ) ( "ext            ">0|2^2 )
  252.    ( "nostat            ">0|1 ) ( "stat           ">0|1^1 )
  253.  
  254.    ( "default           ">0=0 )
  255.    ( "slow           ">0=10616 ) ; == ( "slow ">0=0|16|8|96|256|2048|8192 )
  256.                                  ; use: nohigh nopos nofull notime nomagic nold
  257.  
  258.  
  259.    ( "tags         ">1+1>2<1@ )
  260.    ( "gotags       ">1+1>3<1@ )
  261.    ( "spell        ">1+1>4<1@ )
  262.    ( "make         ">1+1>5<1@ )
  263.    ( "mail         ">1+1>6<1@ )
  264.    ( "nn           ">1+1>7<1@ )
  265. )
  266. ( mode-limiter "  )
  267. ( line-limiter "< )
  268. ( shift-mark "> )
  269. ;OCL}}}
  270. ;OCL{{{  multiple mode stuff (declaration and Modestrings)
  271. ;OCL{{{  kbd-tables
  272. ( defmodes
  273.    ( edit         ; editing
  274.      moves        ; mark regions for modified actions
  275.      buffer-move  ; vary buffers
  276.      para         ; dummy for prompts
  277.      mv-indent    ; special table for indent region
  278.      @if-using ( SHELL-MODE )
  279.         I-Main-Menu  ; Main-menu keys
  280.         I-File-Menu  ; file handling keys, selecting is allowed too
  281.         I-Browser    ; Show info mode
  282.      @fi
  283.    )
  284. )
  285. ;OCL}}}
  286. ;OCL{{{  modestrings
  287. @if-using ( SHELL-MODE )
  288.    ( defmodestring I-ENT       "Sublevel:        "Sub:             )
  289.    ( defmodestring I-XS-FILE   "<=Shell=File=>   "<=Shell=File=>   )
  290.    ( defmodestring I-XS-BROWSE "<=Shell=Browse=> "<=Shell=Browse=> )
  291.    ( defmodestring I-XS-EDIT   "<=Shell=Edit=>   "<=Shell=Edit=>   )
  292.    ( defmodestring I-XS-MAIN   "<=Shell=>        "<=Shell=>        )
  293. @fi
  294. @if-using ( SUNEDT )
  295.    ( defmodestring EDT-TAG     "EDT              "EDT              )
  296. @fi
  297. ( defmodestring ED             "Edit             "E                )
  298. ( defmodestring MV             "Move             "M                )
  299. ( defmodestring NOEX           "Raw              "R                )
  300. @if-using (L-EXT)
  301.    ( defmodestring LEXT        "Ext              "X                )
  302. @fi
  303. ( defmodestring STEP           "%                "%                )
  304. ( defmodestring AI             ">                ">                )
  305. ( defmodestring SH             "ShiftRegion      "ShiftRegion      )
  306. ( defmodestring BM             "BufferCmd        "BufferCmd        )
  307. ( defmodestring BC             "BufferChg        "BufferChg        )
  308. ( defmodestring BZ             "BufferSize       "BufferSize       )
  309. ( defmodestring BN             "BufferNew        "BufferNew        )
  310. ( defmodestring FM             "FileCommand      "FileCommand      )
  311. ( defmodestring TM             "ToggleModes      "ToggleModes      )
  312. ( defmodestring PM             "SetParameter     "SetParameter     )
  313. ( defmodestring BS             "BuSa             "B                )
  314. @if-using ( SUNEDT )
  315.    ( defmodestring EDT-backup  "<-               "<                )
  316. @fi
  317. ;OCL}}}
  318. ;OCL{{{  overload prefix
  319. ( overload-prefix
  320.    ( m-m-     ; move-mode variants
  321.      e-m-     ; edit-mode variants
  322.      b-m-     ; buffer-handling variants
  323.      mori-    ; modeori variants
  324.      raw-     ; for deletings
  325.      @if-using ( SHELL-MODE )
  326.         I-    ; ModeOriShell
  327.      @fi
  328.      @if-using ( SUNEDT )
  329.         EDT-
  330.      @fi
  331.    )
  332. )
  333. ;OCL}}}
  334. ;OCL}}}
  335. ;OCL{{{  character-classes
  336. ( defset word-char-text ( alpha digit ) )
  337. ( defset word-char-coding ( alpha digit "_ ) )
  338. ( defset word-char-ocl ( alpha digit "_ "- ) )
  339. ( defset word-char ( word-char-text ) )
  340. ;OCL}}}
  341. @lib modeori-fun/functions
  342. @lib modeori-fun/spec-fun
  343. @lib modeori-fun/bindings
  344. ;OCL{{{  some unneeded macros, towers..
  345. @if-using ( GAMES )
  346.    ( demand-load
  347.       (
  348.         ;OCL{{{  towers of hanoy
  349.         @lib towers
  350.         ( mode edit
  351.            ( keybind tower-display ( $esc "t "o "1 ) )
  352.            ( keybind towers-of-hanoi ( $esc "t "o "2 ) )
  353.         )
  354.         ;OCL}}}
  355.         ;OCL{{{  sokoban
  356.         ;OCL{{{  define the game
  357.         ( defmac SOKOBAN-RESET-KBD ( edit ) )
  358.         @lib sokoban
  359.         ;OCL{{{  redefine the game, handling prompting,shift and position
  360.         ( deffun mori-sokoban
  361.            ( add-mode-full-shift
  362.              set prompting true
  363.              if show-position
  364.               ( delete-mode-position
  365.                 sokoban
  366.                 add-mode-position
  367.               )
  368.              else
  369.               ( sokoban )
  370.              fi
  371.              set prompting false
  372.              if not(full-shifting)
  373.               ( delete-mode-full-shift )
  374.              fi
  375.            )
  376.         )
  377.         ;OCL}}}
  378.         ;OCL{{{  abort-hook-add
  379.         @if-using not(ABORT-HOOK-ADD)
  380.            @use (ABORT-HOOK-ADD)
  381.            ( defmac abort-hook-add ( ) )
  382.         @fi
  383.         ( defmac abort-hook-add-saved ( abort-hook-add ) )
  384.         ( undeclare ( abort-hook-add ) )
  385.         ( defmac abort-hook-add
  386.            ( abort-hook-add-saved
  387.              if not(full-shifting)
  388.               ( delete-mode-full-shift )
  389.              fi
  390.            )
  391.         )
  392.         ( undeclare ( abort-hook-add-saved ) )
  393.         ;OCL}}}
  394.         ;OCL}}}
  395.         ;OCL{{{  bind it
  396.         ( mode edit
  397.            ( keybind mori-sokoban ( $esc "s "o ) )
  398.         )
  399.         ;OCL}}}
  400.         ;OCL{{{  bind the cursor keys to the game
  401.         @if-using not( ALIEN-KEYS )
  402.            ( mode sokoban-kbd
  403.  
  404.              @if-using ( cursor-key )
  405.                 ;OCL{{{  cursor-maps
  406.                 ( terminal
  407.                    ( @use ( use-cursor-key )
  408.                         @lib modeori-fun/terms
  409.                      @use not( use-cursor-key )
  410.                    )
  411.                    ( keybind soko-go-or-push-left ( $left ) )
  412.                    ( keybind soko-go-or-push-right ( $right ) )
  413.                    ( keybind soko-go-or-push-down ( $down ) )
  414.                    ( keybind soko-go-or-push-up ( $up ) )
  415.                 )
  416.                 ;OCL}}}
  417.              @fi
  418.              @if-using ( r-key )
  419.                 ;OCL{{{  SUN-terminal R-keys
  420.                 ( terminal
  421.                    ( @use( use-r-key )
  422.                         @lib modeori-fun/terms
  423.                      @use not( use-r-key )
  424.                    )
  425.                    ( keybind soko-go-or-push-left ( $R10 ) )
  426.                    ( keybind soko-go-or-push-right ( $R12 ) )
  427.                    ( keybind soko-go-or-push-up ( $R8 ) )
  428.                    ( keybind soko-go-or-push-down ( $R14 ) )
  429.                 )
  430.                 ;OCL}}}
  431.              @fi
  432.              ;OCL{{{  some control keys (wordstar like?)
  433.              ( keybind soko-go-or-push-left ( C-S ) )
  434.              ( keybind soko-go-or-push-right ( C-D ) )
  435.              ( keybind soko-go-or-push-up ( C-E ) )
  436.              ( keybind soko-go-or-push-down ( C-X ) )
  437.              @if-using ( ctrl-h-key )
  438.                 ;OCL{{{  ctrl-h
  439.                 ( terminal
  440.                    ( @use ( use-ctrl-h-key )
  441.                         @lib modeori-fun/terms
  442.                      @use not( use-ctrl-h-key )
  443.                    )
  444.                 )
  445.                 ;OCL}}}
  446.              @fi
  447.              ;OCL}}}
  448.              @if-using ( edt-key )
  449.                 ;OCL{{{  some keypad simualtion bindings for edt
  450.                 ( terminal
  451.                    ( @use ( use-edt-key )
  452.                         @lib modeori-fun/terms
  453.                      @use not( use-edt-key )
  454.                    )
  455.                 )
  456.                 ;OCL}}}
  457.              @fi
  458.            )
  459.         @fi
  460.         ;OCL}}}
  461.         ;OCL}}}
  462.       )
  463.    )
  464. @fi
  465. ;OCL}}}
  466. ;OCL{{{  now define unloading all demand stuff
  467. ( deffun lib-abort-hooks
  468.    ( @if-using ( ABORT-HOOK-ADD )
  469.         abort-hook-add
  470.      @fi
  471.    )
  472. )
  473. ;OCL}}}
  474. @lib modeori-fun/references
  475.